import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object PV {
  def main(args:Array[String]) : Unit = {
    //1.构建SparkConf
    val sparkConf : SparkConf = new SparkConf().setAppName("PV").setMaster("local[2]")

    //2.构建SparkContext
    val sc = new SparkContext(sparkConf)

    val data : RDD[String] = sc.textFile("data/access.log")

    val pv = data.count()

    print("PV:"+pv)

    sc.stop()
  }
}
